package com.dong.bean.scope;

import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * description
 *
 * @author Administrator 2021/09/03 14:44
 */
public class ScopeTest {

    public static void main(String[] args) {
        ApplicationContext context = new AnnotationConfigApplicationContext("com.dong.bean.scope");

        MyBean myBean = context.getBean(MyBean.class);
        System.out.println(myBean);

        MyBean myBean2 = context.getBean(MyBean.class);
        System.out.println(myBean2);

        new Thread(()->{
            MyBean myBean1 = context.getBean(MyBean.class);
            System.out.println(myBean1);
        }).start();
    }
}
